package com.jeecg.demo.service.impl;

import com.jeecg.demo.entity.TTlTiaok;
import com.jeecg.demo.entity.VEcpHetglinfoEntity;
import com.jeecg.demo.service.VEcpHetglinfoServiceI;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

@Service("vEcpHetglinfoService")
@Transactional
public class VEcpHetglinfoServiceImpl extends CommonServiceImpl implements VEcpHetglinfoServiceI {

	@Autowired
	private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
	
 	public void delete(VEcpHetglinfoEntity entity) throws Exception{
 		super.delete(entity);
 	}
 	
 	public Serializable save(VEcpHetglinfoEntity entity) throws Exception{
 		Serializable t = super.save(entity);
 		return t;
 	}
 	
 	public void saveOrUpdate(VEcpHetglinfoEntity entity) throws Exception{
 		super.saveOrUpdate(entity);
 	}

	public List<TTlTiaok> findTiaokInfo(String lx) {
		List<TTlTiaok> ret = null;
		String sql = "";

		try {
			sql = " from TTlTiaok  ";
			if (null != lx && !lx.equals("")) {
				sql = sql + " where  tiaoklx='" + lx + "'";
			}
			else {
				sql = sql + " where  paix='0' ";
			}
			sql = sql + " order by sysid ";

			System.out.println(sql);
			ret = super.findByQueryString(sql);
		}
		catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return ret;
	}
}